package org.etnaframework.module.cron.autoconfigure;

import org.etnaframework.module.cron.CronInitializer;
import org.etnaframework.module.cron.ICronCustomizer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 定时任务初始配置
 *
 * @author jasyaf
 * @since 2024-04-06
 */
@Configuration
@ConditionalOnWebApplication
public class CronConfiguration {

    @Bean
    public CronInitializer crontabInitializer(ICronCustomizer crontabCustomizer) {
        return new CronInitializer(crontabCustomizer);
    }
}
